﻿@model AlbumVM
<div class="col-sm-4 col-md-3 col-lg-2  item-container" id="@string.Format("container{0}",Model.Id)">
    <div class="panel panel-default" >
        <div class="panel-heading">
            @Model.Title
        </div>
        <div class="panel-body">
            <img src="@Model.Cover" class="img-responsive" />
        </div>


        <div class="panel-footer text-center">
            @if (Model.Active)
            {
                <a href="#" data-url="@Url.Action("IsActive", new {id = Model.Id})" class="active-item btn btn-default btn-sm" title="激活" data-action="锁定">
                    <i class="fa fa-check text-success"></i>
                </a>

            }
            else
            {
                <a href="#" data-url="@Url.Action("IsActive", new {id = Model.Id})" class="active-item btn btn-default btn-sm" title="锁定" data-action="激活">
                    <i class="fa fa-remove text-danger"></i>
                </a>
            }

            <a href="@Url.Action("Index","Photo",new { albumId = Model.Id})" class="btn btn-info btn-sm">
                <i class="fa fa-cloud-upload"></i>
            </a>

            @Ajax.RawActionLink("<i class='fa fa-edit'></i>",
                        "Edit", "Album",
                        new { id = Model.Id },
                        new AjaxOptions { HttpMethod = "Get", UpdateTargetId = "edit-container", OnComplete = "onAjaxComplete", OnSuccess = "OnSuccessLink" },
                        new { @class = "btn btn-primary btn-sm", title = Buttons.Edit })

            <a href="#" data-url="@Url.Action("Delete", new {id = Model.Id})" class="btn btn-danger btn-sm delete-item" title="@Buttons.Delete">
                <i class="fa fa-trash-o"></i>
            </a>
        </div>
    </div>
</div>